import { defineConfig } from 'vitepress';
import sidebar from './config/sidebar.json';

// https://vitepress.dev/reference/site-config
export default defineConfig({
  base: '/',
  outDir: 'dist',
  lang: 'zh-cn',
  title: '笔记记录',
  description: '我的笔记文档',
  head: [
    ['link', { rel: 'icon', href: '/favicon.ico' }],
    ['meta', { name: 'viewport', content: 'width=device-width,initial-scale=1,user-scalable=no' }],
    ['link', { rel: 'manifest', href: '/manifest.json' }],
    ['meta', { name: 'theme-color', content: '#3eaf7c' }],
    ['meta', { name: 'apple-mobile-web-app-capable', content: 'yes' }],
    ['meta', { name: 'apple-mobile-web-app-status-bar-style', content: 'black' }],
    ['link', { rel: 'apple-touch-icon', href: '/icons/book.png' }],
    ['link', { rel: 'mask-icon', href: '/icons/book.svg', color: '#3eaf7c' }],
    ['meta', { name: 'msapplication-TileImage', content: '/icons/book.png' }],
    ['meta', { name: 'msapplication-TileColor', content: '#000000' }]
  ],
  themeConfig: {
    // https://vitepress.dev/reference/default-theme-config
    logo: '/logo.png',
    siteTitle: '我的笔记文档',
    nav: [{ text: '首页', link: '/' }],
    sidebar: sidebar,
    socialLinks: [{ icon: 'github', link: 'https://gitee.com/haijunit/vitepress-demo' }],
    outline: {
      level: [2, 6],
      label: '目录'
    },
    editLink: {
      pattern: 'https://gitee.com/haijunit/vitepress-demo/edit/main/docs/:path',
      text: '编辑此页'
    },
    lastUpdated: {
      text: '最后更新'
    },
    docFooter: {
      prev: '上一篇',
      next: '下一篇'
    },
    lightModeSwitchTitle: '明亮主题',
    darkModeSwitchTitle: '暗黑主题',
    returnToTopLabel: '返回顶部',
    langMenuLabel: '切换语言',
    notFound: {
      title: 'PAGE NOT FOUND',
      quote: '页面丢失了...',
      linkText: '回到首页'
    },
    search: {
      provider: 'local'
    }
  },
  markdown: {
    lineNumbers: true,
    breaks: true
  },
  vite: {
    resolve: {
      alias: []
    },
    plugins: []
  }
});
